package com.example.userinfoapi;

import com.example.blogcommon.pojo.Result;
import com.example.userinfoapi.request.UserInfoRegisterRequest;
import com.example.userinfoapi.request.UserInfoRequest;
import com.example.userinfoapi.response.UserInfoResponse;
import com.example.userinfoapi.response.UserLoginResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "user-info-service", path = "/user")
public interface UserServiceApi {
    @RequestMapping("/login")
    public Result<UserLoginResponse> login(@RequestBody UserInfoRequest user);

    @RequestMapping("/getUserInfo")
    public Result<UserInfoResponse> getUserInfo(@RequestParam("userId") Integer userId);

    @RequestMapping("/getAuthorInfo")
    public Result<UserInfoResponse> getAuthorInfo(@RequestParam("blogId") Integer blogId);

    @RequestMapping("/register")
    public Result<Integer> register(@RequestBody UserInfoRegisterRequest registerRequest);
}
